home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / program / knobvb25.zip / DELPHI.ZIP / KNOB25.PAS < prev    next >
Pascal/Delphi Source File  |  1996-01-13  |  14KB  |  309 lines

  1. {********************************************}
  2. {*                                          *}
  3. {*   KNOB25.PAS generated from KNOB25.VBX   *}
  4. {*                                          *}
  5. {********************************************}
  6.  
  7. unit Knob25;
  8.  
  9. interface
  10.  
  11. uses SysUtils, Classes, Graphics, Forms, Controls, VBXCtrl, BIVBX;
  12.  
  13. { $DEFINE InitTKnob}
  14. {^- Remove space to enable default init data -- See documentation. }
  15.  
  16. type
  17.   TKnobTurnEvent = procedure (Sender: TObject) of object;
  18.  
  19.   { TKnob }
  20.  
  21.   TKnob = class(TVBXControl)
  22.   protected
  23.     FOnTurn: TKnobTurnEvent;
  24.     { Event handler }
  25.     procedure HandleVBXEvent(var Message: TWMVBXFireEvent); override;
  26.     procedure DefineProperties(Filer: TFiler); override;
  27.   public
  28.     constructor Create(AOwner: TComponent); override;
  29.  
  30.     property Index: TVBInteger index 0 read GetIntProp;
  31.     property FontName: TVBString index 13 read GetStringProp write
  32.       SetStringProp;
  33.     property FontBold: Boolean index 14 read GetBoolProp write SetBoolProp;
  34.     property FontItalic: Boolean index 15 read GetBoolProp write SetBoolProp;
  35.     property FontStrikethru: Boolean index 16 read GetBoolProp write
  36.       SetBoolProp;
  37.     property FontUnderline: Boolean index 17 read GetBoolProp write
  38.       SetBoolProp;
  39.     property FontSize: Single index 18 read GetSingleProp write SetSingleProp;
  40.     property AVersion: Single index 19 read GetSingleProp write SetSingleProp;
  41.     property ZLoad: TVBInteger index 20 read GetIntProp write SetIntProp;
  42.     property Angle: Single index 39 read GetSingleProp write SetSingleProp;
  43.     property XScale: Single index 40 read GetSingleProp write SetSingleProp;
  44.     property YScale: Single index 41 read GetSingleProp write SetSingleProp;
  45.     property Radius: Single index 42 read GetSingleProp write SetSingleProp;
  46.     property Value: Single index 43 read GetSingleProp write SetSingleProp;
  47.     property Redraw: Boolean index 103 read GetBoolProp write SetBoolProp;
  48.     property RedrawStatic: Boolean index 104 read GetBoolProp write
  49.       SetBoolProp;
  50.   published
  51.     property Enabled;
  52.     property Visible;
  53.     property MousePointer: TVBEnum index 8 read GetEnumProp write SetEnumProp
  54.       default 0;
  55.     property TabOrder;
  56.     property TabStop;
  57.     property About: TVBString index 21 read GetStringProp {NoRT}write
  58.       SetStringProp stored False;
  59.     property BorderType: TVBEnum index 22 read GetEnumProp write SetEnumProp;
  60.     property BevelWidth: TVBInteger index 23 read GetIntProp write SetIntProp;
  61.     property BevelInner: TVBEnum index 24 read GetEnumProp write SetEnumProp;
  62.     property BevelOuter: TVBEnum index 25 read GetEnumProp write SetEnumProp;
  63.     property BorderWidth: TVBInteger index 26 read GetIntProp write
  64.       SetIntProp;
  65.     property OutlineTitle: TVBString index 27 read GetStringProp write
  66.       SetStringProp;
  67.     property OutlineColor: TColor index 28 read GetColorProp write
  68.       SetColorProp;
  69.     property OutlineWidth: TVBInteger index 29 read GetIntProp write
  70.       SetIntProp;
  71.     property OutlineAlign: TVBEnum index 30 read GetEnumProp write
  72.       SetEnumProp;
  73.     property FrameStyle: TVBEnum index 31 read GetEnumProp write SetEnumProp;
  74.     property FrameScaleX: Single index 32 read GetSingleProp write
  75.       SetSingleProp;
  76.     property FrameScaleY: Single index 33 read GetSingleProp write
  77.       SetSingleProp;
  78.     property FrameColor: TColor index 34 read GetColorProp write SetColorProp;
  79.     property FramePicture: TVBPic index 35 read GetPictureProp write
  80.       SetPictureProp stored False;
  81.     property BackgroundColor: TColor index 36 read GetColorProp write
  82.       SetColorProp;
  83.     property BackgroundPicture: TVBPic index 37 read GetPictureProp write
  84.       SetPictureProp stored False;
  85.     property MouseControl: Boolean index 38 read GetBoolProp write
  86.       SetBoolProp;
  87.     property ScaleStartAngle: Single index 44 read GetSingleProp write
  88.       SetSingleProp stored False;
  89.     property ScaleStopAngle: Single index 45 read GetSingleProp write
  90.       SetSingleProp stored False;
  91.     property ScaleMinValue: Single index 46 read GetSingleProp write
  92.       SetSingleProp stored False;
  93.     property ScaleMaxValue: Single index 47 read GetSingleProp write
  94.       SetSingleProp stored False;
  95.     property ScaleDirection: TVBEnum index 48 read GetEnumProp write
  96.       SetEnumProp stored False;
  97.     property ScaleOriginX: Single index 49 read GetSingleProp write
  98.       SetSingleProp stored False;
  99.     property ScaleOriginY: Single index 50 read GetSingleProp write
  100.       SetSingleProp stored False;
  101.     property Tics: TVBInteger index 51 read GetIntProp write SetIntProp
  102.       stored False;
  103.     property TicID: TVBInteger index 52 read GetIntProp write SetIntProp
  104.       stored False;
  105.     property TicStyle: TVBEnum index 53 read GetEnumProp write SetEnumProp
  106.       stored False;
  107.     property TicInnerRadius: Single index 54 read GetSingleProp write
  108.       SetSingleProp stored False;
  109.     property TicOuterRadius: Single index 55 read GetSingleProp write
  110.       SetSingleProp stored False;
  111.     property TicLabelRadius: Single index 56 read GetSingleProp write
  112.       SetSingleProp stored False;
  113.     property TicWidth: Single index 57 read GetSingleProp write SetSingleProp
  114.       stored False;
  115.     property TicStartValue: Single index 58 read GetSingleProp write
  116.       SetSingleProp stored False;
  117.     property TicStopValue: Single index 59 read GetSingleProp write
  118.       SetSingleProp stored False;
  119.     property TicDeltaValue: Single index 60 read GetSingleProp write
  120.       SetSingleProp stored False;
  121.     property TicLabel: Boolean index 61 read GetBoolProp write SetBoolProp
  122.       stored False;
  123.     property TicColor: TColor index 62 read GetColorProp write SetColorProp
  124.       stored False;
  125.     property TicFontID: TVBInteger index 63 read GetIntProp write SetIntProp
  126.       stored False;
  127.     property Annulars: TVBInteger index 64 read GetIntProp write SetIntProp
  128.       stored False;
  129.     property AnnularID: TVBInteger index 65 read GetIntProp write SetIntProp
  130.       stored False;
  131.     property AnnularStartValue: Single index 66 read GetSingleProp write
  132.       SetSingleProp stored False;
  133.     property AnnularStopValue: Single index 67 read GetSingleProp write
  134.       SetSingleProp stored False;
  135.     property AnnularColor: TColor index 68 read GetColorProp write
  136.       SetColorProp stored False;
  137.     property AnnularInnerRadius: Single index 69 read GetSingleProp write
  138.       SetSingleProp stored False;
  139.     property AnnularOuterRadius: Single index 70 read GetSingleProp write
  140.       SetSingleProp stored False;
  141.     property Captions: TVBInteger index 71 read GetIntProp write SetIntProp
  142.       stored False;
  143.     property CaptionID: TVBInteger index 72 read GetIntProp write SetIntProp
  144.       stored False;
  145.     property Caption: TVBString index 73 read GetStringProp write
  146.       SetStringProp stored False;
  147.     property CaptionX: Single index 74 read GetSingleProp write SetSingleProp
  148.       stored False;
  149.     property CaptionY: Single index 75 read GetSingleProp write SetSingleProp
  150.       stored False;
  151.     property CaptionColor: TColor index 76 read GetColorProp write
  152.       SetColorProp stored False;
  153.     property CaptionFontID: TVBInteger index 77 read GetIntProp write
  154.       SetIntProp stored False;
  155.     property KnobStyle: TVBEnum index 78 read GetEnumProp write SetEnumProp;
  156.     property KnobUserDefined: TVBString index 79 read GetStringProp write
  157.       SetStringProp;
  158.     property KnobRadius: Single index 80 read GetSingleProp write
  159.       SetSingleProp;
  160.     property KnobValue: Single index 81 read GetSingleProp write
  161.       SetSingleProp;
  162.     property KnobColor: TColor index 82 read GetColorProp write SetColorProp;
  163.     property KnobMultiTurn: Boolean index 83 read GetBoolProp write
  164.       SetBoolProp;
  165.     property KnobMultiTurnValue: Single index 84 read GetSingleProp write
  166.       SetSingleProp;
  167.     property KnobSnap: Boolean index 85 read GetBoolProp write SetBoolProp;
  168.     property KnobSnapIncrement: Single index 86 read GetSingleProp write
  169.       SetSingleProp;
  170.     property KnobPicture: TVBPic index 87 read GetPictureProp write
  171.       SetPictureProp stored False;
  172.     property MarkStyle: TVBEnum index 88 read GetEnumProp write SetEnumProp
  173.       stored False;
  174.     property MarkUserDefined: TVBString index 89 read GetStringProp write
  175.       SetStringProp;
  176.     property MarkColor: TColor index 90 read GetColorProp write SetColorProp
  177.       stored False;
  178.     property MarkInnerRadius: Single index 91 read GetSingleProp write
  179.       SetSingleProp stored False;
  180.     property MarkOuterRadius: Single index 92 read GetSingleProp write
  181.       SetSingleProp stored False;
  182.     property MarkWidth: Single index 93 read GetSingleProp write
  183.       SetSingleProp stored False;
  184.     property Digital: Boolean index 94 read GetBoolProp write SetBoolProp;
  185.     property DigitalX: Single index 95 read GetSingleProp write SetSingleProp;
  186.     property DigitalY: Single index 96 read GetSingleProp write SetSingleProp;
  187.     property DigitalDecimals: TVBInteger index 97 read GetIntProp write
  188.       SetIntProp;
  189.     property DigitalColor: TColor index 98 read GetColorProp write
  190.       SetColorProp;
  191.     property DigitalFontID: TVBInteger index 99 read GetIntProp write
  192.       SetIntProp;
  193.     property FontID: TVBInteger index 100 read GetIntProp write SetIntProp;
  194.     property Fonts: TVBInteger index 101 read GetIntProp write SetIntProp
  195.       stored False;
  196.     property AutoRedraw: Boolean index 102 read GetBoolProp write SetBoolProp;
  197.     property FontDialog_: TVBString index 105 read GetStringProp {NoRT}write
  198.       SetStringProp stored False;
  199.     property OnClick;
  200.     property OnDragDrop;
  201.     property OnEndDrag;
  202.     property OnDragOver;
  203.     property OnEnter;
  204.     property OnKeyDown;
  205.     property OnKeyPress;
  206.     property OnKeyUp;
  207.     property OnExit;
  208.     property OnMouseDown;
  209.     property OnMouseMove;
  210.     property OnMouseUp;
  211.     property OnTurn: TKnobTurnEvent read FOnTurn write FOnTurn;
  212.   end;
  213.  
  214. procedure Register;
  215.  
  216. implementation
  217.  
  218. { Default form data for TKnob }
  219.  
  220. {$IFDEF InitTKnob}
  221.  
  222. const
  223.   TKnobInitLen = 332;
  224.  
  225. procedure TKnobInitData; near; assembler;
  226. asm
  227.     DB    $00,$00,$00,$02,$06,$FF,$FF,$07,$FF,$FF,$08,$00,$09,$00,$00,$0A
  228.     DB    $00,$00,$0B,$00,$0C,$04,$4B,$6E,$6F,$62,$13,$00,$00,$20,$40,$14
  229.     DB    $01,$00,$00,$00,$00,$00,$00,$00,$5C,$43,$00,$00,$0C,$43,$00,$00
  230.     DB    $00,$00,$00,$00,$20,$41,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  231.     DB    $00,$00,$E0,$41,$00,$00,$E0,$41,$00,$00,$5C,$43,$00,$00,$FA,$43
  232.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
  233.     DB    $00,$00,$00,$00,$33,$33,$33,$3F,$9A,$99,$59,$3F,$00,$00,$80,$3F
  234.     DB    $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$20,$41,$00,$00,$80,$3F
  235.     DB    $01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$00,$10,$00,$07,$00
  236.     DB    $00,$00,$00,$00,$BC,$02,$00,$00,$00,$00,$01,$02,$02,$22,$53,$79
  237.     DB    $73,$74,$65,$6D,$00,$00,$53,$65,$72,$69,$66,$00,$80,$0C,$0C,$0C
  238.     DB    $26,$6C,$74,$0A,$02,$00,$36,$F5,$02,$00,$97,$05,$00,$00,$16,$01
  239.     DB    $17,$02,$00,$18,$01,$19,$02,$1A,$02,$00,$1B,$00,$1C,$00,$00,$00
  240.     DB    $00,$1D,$00,$00,$1E,$00,$1F,$00,$20,$00,$00,$00,$00,$21,$00,$00
  241.     DB    $00,$00,$22,$00,$00,$00,$00,$24,$C0,$C0,$C0,$00,$26,$FF,$FF,$27
  242.     DB    $00,$00,$00,$00,$28,$00,$00,$00,$00,$29,$00,$00,$00,$00,$2A,$00
  243.     DB    $00,$00,$00,$2B,$00,$00,$00,$00,$4E,$02,$4F,$00,$50,$9A,$99,$19
  244.     DB    $3F,$51,$00,$00,$00,$00,$52,$80,$80,$80,$00,$53,$00,$00,$54,$00
  245.     DB    $00,$00,$00,$55,$00,$00,$56,$00,$00,$80,$3F,$59,$00,$5E,$00,$00
  246.     DB    $5F,$00,$00,$00,$00,$60,$00,$00,$00,$00,$61,$00,$00,$62,$00,$00
  247.     DB    $00,$00,$63,$00,$00,$64,$00,$00,$66,$FF,$FF,$FF
  248. end;
  249.  
  250. {$ENDIF}
  251.  
  252. { TKnob }
  253.  
  254. constructor TKnob.Create(AOwner: TComponent);
  255. begin
  256.   FVBXFile := StrNew('KNOB25.VBX');
  257.   FVBXClass := StrNew('KNOB');
  258.   SetBounds(0, 0, 80, 32);
  259.   inherited Create(AOwner);
  260.   ControlStyle := ControlStyle - [csCaptureMouse, csClickEvents];
  261.   TabStop := True;
  262.   FVBXFlags := [vfLoadMessage];
  263.   {$IFDEF InitTKnob}
  264.   FHForm := VBXCreateFormFile(TKnobInitLen, @TKnobInitData);
  265.   {$ENDIF}
  266. end;
  267.  
  268. procedure TKnob.HandleVBXEvent(var Message: TWMVBXFireEvent);
  269. begin
  270.   case Message.VBXEvent^.EventIndex of
  271.     0: DispatchNotifyEvent(OnClick);
  272.     1: begin end; { VCL Handles OnDragDrop }
  273.     2: begin end; { VCL Handles OnDragOver }
  274.     3: begin end; { VCL Handles OnGotFocus }
  275.     4: DispatchKeyEvent(OnKeyDown, Message);
  276.     5: DispatchKeyPressedEvent(OnKeyPress, Message);
  277.     6: DispatchKeyEvent(OnKeyUp, Message);
  278.     7: begin end; { VCL Handles OnLostFocus }
  279.     8: DispatchMouseEvent(OnMouseDown, Message);
  280.     9: DispatchMouseMoveEvent(OnMouseMove, Message);
  281.     10: DispatchMouseEvent(OnMouseUp, Message);
  282.     11: DispatchCustomEvent(FOnTurn, Message, 11);
  283.   end;
  284. end;
  285.  
  286. procedure TKnob.DefineProperties(Filer: TFiler);
  287. begin
  288.   inherited DefineProperties(Filer);
  289.   HandleProperty('AVersion', Filer, 19);
  290.   HandleBinaryProperty('ZLoad', Filer, 20);
  291.   HandleBinaryProperty('FramePicture_Data', Filer, 35);
  292.   HandleBinaryProperty('BackgroundPicture_Data', Filer, 37);
  293.   HandleProperty('Angle', Filer, 39);
  294.   HandleProperty('XScale', Filer, 40);
  295.   HandleProperty('YScale', Filer, 41);
  296.   HandleProperty('Radius', Filer, 42);
  297.   HandleProperty('Value', Filer, 43);
  298.   HandleBinaryProperty('KnobPicture_Data', Filer, 87);
  299. end;
  300.  
  301. { Designer registration }
  302. procedure Register;
  303. begin
  304.   RegisterComponents('VBX', [
  305.     TKnob]);
  306. end;
  307.  
  308. end.
  309.